const express = require("express");
const app = express();

const AxiosRequest = require('./request');

// 创建一个 AxiosRequest 实例
const api = new AxiosRequest('http://43.138.12.162:8091');
const params = {
    key: "",
    pageNo: 1,
    pageSize: 10,
}

// 设置自定义请求头
api.setHeaders({
    'Authorization': 'Bearer 7c67f459-813a-40f2-9c7a-f9249b5d5d3e',
});

// 发送 GET 请求
api.get('/zyjy-knowleges-api/manage/specially/types/list', params)
    .then(response => {
        console.log(response.data);
    })
    .catch(error => {
        console.error(error);
    });
// 启动服务器并监听指定端口（比如 8021）
const port = 8021;
app.listen(port, () => {
    console.log(`Server is listening on port ${port}`);
});
